// marker.h: interface for the Marker class.
//
//////////////////////////////////////////////////////////////////////

#ifndef MARKER_H
#define MARKER_H

#include <QWidget>
#include <QPainter>

#include "plot.h"

class Marker : public QObject
{
	Q_OBJECT

public:
	Marker();
	virtual ~Marker();

	void setPlot(Plot* newPlot);
	void setName(const QString& newName);
	QString	getName();

	Plot* getPlot();

	void draw(QPainter &p);
	bool moveToPoint(const QPoint& point);
	bool moveToIndex(const int& i);
	bool moveToXValue(const double &value);

	double getValue();

	QPoint currentPoint();
	int currentIndex();
	bool contains(const QPoint& point);

	void setColor(QColor color);
	QColor getColor();

	void setFont(QFont font);
	QFont getFont();

private:
	QColor		mColor;
	QString		name;
	QRect		area;
	QPoint		centerPoint;
	int			index;

	/* The plot this marker is associated with */
	Plot*		plot;
	
	QFont mFont;
};

#endif
